﻿using System;
using System.Collections.Generic;
using System.Data;
using System.Linq;
using System.Text;
using EmoneyWeiXinCommon;
using EmoneyWeiXinEntity;
using System.Data.SqlClient;

namespace EmoneyWeiXinDAL
{
    public class dimensionDAL
    {
        public void getWX_Business_GroupUserScanUpdate(WX_Business_GroupUserScanEntity wxBusinessentity)
        {
            try
            {
                if (wxBusinessentity != null && !string.IsNullOrEmpty(wxBusinessentity.FromUserName))
                {
                    //string sql = "insert into WX_Business_GroupUserScan(UserMsgType, FromUserName, UserEVENT, UserEventKey, UserTicket, createtime, weixinid) values(";
                    //sql += "'" + wxBusinessentity.UserMsgType + "',";
                    //sql += "'" + wxBusinessentity.FromUserName + "',";
                    //sql += "'" + wxBusinessentity.UserEVENT + "',";
                    //sql += "'" + wxBusinessentity.UserEventKey + "',";
                    //sql += "'" + wxBusinessentity.UserTicket + "',";
                    //sql += "'" + wxBusinessentity.Createtime + "',";
                    //sql += "'" + wxBusinessentity.Weixinid + "'";
                    //sql += ")";
                    string sql = "Insert_WxBusiness_groupUserScan";
                    SQLHelper.ExecuteNonQuery(Config.EmoneyWeiXin, CommandType.StoredProcedure, sql, SQLTools.Entity2ParaArry<WX_Business_GroupUserScanEntity>(wxBusinessentity));
                }
            }
            catch (Exception)
            {

                throw;
            }
        }


        public void InsertSaoMiaoJiLUFor917(WX_Business_GroupUserScanEntity entity) 
        {
            string  type = "";
            string meitiPara = System.Configuration.ConfigurationManager.AppSettings["meitierweimaPara"];
            string jiabinPara = System.Configuration.ConfigurationManager.AppSettings["jiabinerweimaPara"];
            if (entity.twocodePara == meitiPara)
            {
                type = "meiti";
            }
            else 
            {
                type = "jiabin";
            }
            string sql = "INSERT INTO SaoMiaoJiLUFor917 values(@openId,@para,@lbType,@IsSendRedBag,@isLock)";
            SqlParameter[] paras = 
            {
             new SqlParameter("@openId",entity.FromUserName),
             new SqlParameter("@para",entity.twocodePara),
             new SqlParameter("@lbType",type),
             new SqlParameter("@IsSendRedBag",0),
             new SqlParameter("@isLock",0),
            };
        }


       // public 

    }
}
